//
//  setTradingPassword.m
//  jiaKaoZhuShou
//
//  Created by 金艺社 on 2018/5/29.
//  Copyright © 2018年 金艺社. All rights reserved.
//

#import "setTradingPassword.h"

@interface setTradingPassword ()
@property (weak, nonatomic) IBOutlet UITextField *firstPassword_tf;
@property (weak, nonatomic) IBOutlet UITextField *secondPassword_tf;
@property (weak, nonatomic) IBOutlet UIButton *confirm_btn;

@end

@implementation setTradingPassword

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"设置交易密码";
    self.confirm_btn.layer.masksToBounds = YES;
    self.confirm_btn.layer.cornerRadius = 22;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (IBAction)confirmClick:(id)sender {
    [self setTradPassword];
}
#pragma mark --- 修改交易密码
- (void)setTradPassword {
    NSString *token = USERTOKEN;
    NSDictionary *dic = @{
                          @"token":token,
                          @"newPassword":self.firstPassword_tf.text
                          };
    [networkManger PostHttpDataWithUrlStr:[[apiManger shareApiManger] setAndModifyTradPassword] Dic:dic SuccessBlock:^(id responseObject) {
        
        if ([responseObject[@"rcd"] isEqualToString:R0001]) {
            [self.navigationController popViewControllerAnimated:YES];
        }else {
            [MBProgressHUD gk_toastShowMessage:responseObject[@"rmg"]];
        }
    } FailureBlock:^(id error) {
        [MBProgressHUD gk_toastShowMessage:@"请求失败"];
    }];
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
